// 全局要用的类型放到这里

type IResData<T> = {
  code: number | string;
  message: string;
  data: T;
}

type IResDataInfo<T> = {
  countId: string;
  current: number;
  maxLimit: number;
  optimizeCountSql: boolean;
  orders: any[];
  pages: number;
  records: T[];
  searchCount: number;
  size: number;
  total: number;
}

// uni.uploadFile文件上传参数
type IUniUploadFileOptions = {
  file?: File
  files?: UniApp.UploadFileOptionFiles[]
  filePath?: string
  name?: string
  formData?: any
}

type UserBehaviorInfoStatisticsVo = {
  id:           string;
  operator:     string | number;
  operateTime:  string;
  /** 喜欢数量 */
  likeNum:      number;
  /** 收藏数量 */
  collectNum:   number;
  /** 联系数量 */
  chatNum:      number;
  /** 被联系数量 */
  chatedNum:    number;
  /** 被浏览数量 */
  viewedNum:    number;
}

type IUserInfo = Optional<{
  id:                           string;
  creator:                      any;
  createTime:                   string | any;
  operator:                     any;
  operateTime:                  any;
  deleter:                      any;
  deleteTime:                   any;
  deleteFlag:                   any;
  username:                     string | any;
  password:                     any;
  phone:                        string;
  code:                         string;
  status:                       string;
  wechatOpenid:                 string | any;
  wechatUnionid:                string | any;
  avatar:                       string | any;
  source:                       string | any;
  self:                         string | any;
  wechatBindTime:               string;
  introUserId:                  string;
  token:                        string;
  verificationFlag:             boolean;
  membershipFlag:               boolean;
  userProfileInfoVo:            any;
  userSettingsInfoVo:           any;
  identityVerificationVo:       any;
  personAvatar:                 any;
  collect:                      any;
  like:                         any;
  userBehaviorInfoStatisticsVo: UserBehaviorInfoStatisticsVo;
  userMembershipInfoVo:         any;
}>

enum TestEnum {
  A = 'a',
  B = 'b',
}

type AnyObj = { 
  [key: string | number | symbol]: any;
}

/**
 * normal(正常) - loading(加载中) - more(还有数据) - finished(没有更多了) - error(请求错误)
 */
type LoadingStatus = 'normal' | 'loading' | 'more' | 'finished' | 'error';